package com.situ.mall.pattern.observer.observable;


import java.util.Observable;
import java.util.Observer;

public class Reader implements Observer {
    private String name;

    public Reader(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable o, Object obj) {
        System.out.println(name + "收到报纸了，推送过来的内容是：" + obj);
        System.out.println(name + "收到报纸了，拉去过来的内容是：" + ((NewsPaper)o).getContent());
    }
}
